package com.mcf.xiaolinju.controller;


import com.mcf.xiaolinju.entity.Goods;
import com.mcf.xiaolinju.service.impl.GoodsServiceImpl;
import com.mcf.xiaolinju.vo.GoodsListVO;
import com.mcf.xiaolinju.vo.GoodsVO;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mcf
 * @since 2022-02-26
 */
@CrossOrigin
@RestController
@RequestMapping("/xiaolinju/goods")
public class GoodsController {
    @Resource
    GoodsServiceImpl goodsService;
    @RequestMapping("/insertgoods")
    public String insertgoods(int userid, int villageid, int classifyid, String name, String brand, String type, String extent, String channel, String content, String price, String priced, String count, String buytime, String pictureurl) {

        return  goodsService.insertgoods(userid,villageid,classifyid,name,brand,type,extent,channel,content,price,priced,count,buytime,pictureurl);
    }
    @RequestMapping("/selectbyclassfyid")
    public List<GoodsVO>  selectbyclassfyid(int classfyid,int villageid)
    {


        return  goodsService.selectbyclassfyid(classfyid,villageid);
    }
    @RequestMapping("/getallbyid")
    public GoodsListVO selectbyid(int id,int villageid){
        return  goodsService.selectbyid(id,villageid);
    }





}
